-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/checksum: Add LSB-first (reflected) CRC8 Function #21543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest fixup adds a dedicated test with the Onewire parameters, because why not. |
|
We should probably consider renaming the But also, the reflected version does operate least significant bit first, so the |
There is some value in having that discussion before merging, because afterwards, once a Release has happened, we would have to deprecate the old function name if we decided to change it. However I'm a bit torn, because the new function does not reflect the data, it just works LSB first (which is equivalent to reflecting the data beforehand). But on the other side, Maxim doesn't really call that algorithm "reflected". |
Could it be that you are not yet aware of how much energy the RIOT community has for bike-shedding and that discussions about naming easily take many months? 🤣 If we were to change the name, we would have to add a backward compatible alias for the CRC16 variant anyway. I think it would not make much difference to do the same for CRC8. I'm personally fine with either name, especially as the doc here states both terminologies, so that people will find the function they are looking for easily. |
|
Well then let's get this merged so I can get back to poking @Enoch247 :) |
Contribution description
Currently only an MSB-first CRC8 function is implemented with a note telling the caller to reflect the data themselves. This PR adds an LSB-first CRC8 function, so the data doesn't have to be reflected manually. With more data, this can take a significant amount of time.
Testing procedure
Run the unittests and CI.
Issues/PRs references
Required for #19848.